package com.twq.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;

public class LoginServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setCharacterEncoding("utf-8");
        req.setCharacterEncoding("utf-8");
        //处理这个请求
        String username = req.getParameter("username");
        String password = req.getParameter("password");
        String [] hobbys = req.getParameterValues("hobbys");

//        System.out.println(username);
//        System.out.println(password);
//        System.out.println(Arrays.toString(hobbys));

//       请求转发
        req.getRequestDispatcher("/success.jsp").forward(req,resp);

    }


}
